The present invention relates to the control of lighting systems, and more specifically, to an improved method and apparatus for controlling a ballast to drive a lighting device or similar such device.
Pulse Width Modulation (PWM) generators are used in a variety of applications to control power delivered to an electronic device. In the control of a ballast for use in driving a electronic lighting or similar device, one of four different modes is typically utilized. More specifically, the control circuitry for the ballast usually generates one of four different sets of signals, and wherein the mode defines the particular relationship of two different sequences of pulses (i.e. wave forms) that emanate from the control circuitry and are utilized to drive the ballast. The two control waveforms are then input into the gates of different transistor switches, turning the switches off and on to generate the required pulse width modulated signal. The two waveforms are therefore referred to as G1 and G2, since they are used as gating signals to two different switches. The switches are usually implemented as transistors.
In the first mode, the waveforms shown as 201 in FIG. 2 are generated. The control waveforms G1 and G2 utilized in additional modes are depicted as 202 through 204, respectively in FIG. 2. The four different modes all generate the two gating signals G1 and G2, but these are differences between the modes.
As shown in FIG. 2, in the first mode the waveforms are opposites of one another, no offset or delay between the two. In a second mode 202, the waveforms are separated by a delay of T3 between the end of G1 and the beginning of the pulse G2. In mode three, the wave forms are also separated by a delay T3, but the pulse width of the two waves is different between the two waveforms, and in mode four the waveforms are overlapping and of different widths.
In practical systems, such as those utilized by the assignee of the present invention, the four sets of waveforms described herein are suitable to meet the command and control needs of most systems.
Typically, the control waveforms are generated using either analog or hardwired digital circuitry. An analog implementation conventionally uses a voltage-controlled oscillator (VCO) and an analog comparator to control a pulse width based upon an analog feedback loop. A digital PWM control circuit is typically implemented using a digital counter and register.
The digital implementation is normally preferred due to its increased accuracy and the fact that it is not as susceptible to temperature changes, etc. However, to date, there does not exist a flexible PWM generator that can create any of the required four waveforms, and which also includes reliable protection circuitry. There exists a need for such a system, along with the ability to change modes for different types of operation.
The above and other problems of the prior art are overcome in accordance with the present invention. More specifically, a multi-function PWM module is designed to generate any of several waveforms that may be utilized to drive a ballast.
The inventive technique uses a programmable set of registers in combination with configurable logic circuitry in order to emulate different hardware arrangements that would otherwise generate a specific one of the four possible sets of waveforms.
In the preferred embodiment, values are programmed into a control register, and such values are then used to configure the logic circuitry for a specified delay and offset with respect to two signals.